package com.cn.controller;

import com.cn.service.EmployeeSevice.EmployService;
import com.cn.service.GoodsService.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ClassName EmployeeController
 * @Description TODO
 * @Author yujiajing
 * @Date 2022/10/13 20:10
 * @Version 1.0
 */
@Controller
@RequestMapping("/employee")
public class EmployeeController {
    //Bean注入
    @Autowired
    EmployService employService;
    @RequestMapping(value = "/delete" ,method =RequestMethod.POST )
    @ResponseBody
    public void deleteEmployeeById(@RequestBody String employ_id){

        String RealId=employ_id.substring(3);
        System.out.println(RealId);
        employService.fireEmployee(RealId);
    }
}
